<?php defined('BASEPATH') or exit('No direct script access allowed.'); ?><?php defined('BASEPATH') or exit('No permission resources.'); ?>
<form class="form-horizontal" role="form" id="validateform" name="validateform" action="<?php echo base_url('adminpanel/equipment/edit')?>" >
	<div class='panel panel-default '>
		<div class='panel-heading'>
			<i class='fa fa-table'></i> 设备管理 修改信息
			<div class='panel-tools'>
				<div class='btn-group'>
					<a class="btn " href="<?php echo base_url('adminpanel/equipment')?>"><span class="glyphicon glyphicon-arrow-left"></span> 返回 </a>
				</div>
			</div>
		</div>
		<div class='panel-body '>
								<fieldset>
						<legend>基本信息</legend>
													
	<div class="form-group">
				<label for="title" class="col-sm-2 control-label form-control-static">设备名称</label>
				<div class="col-sm-9 ">
					<input type="text" name="title"  id="title"  value='<?php echo isset($data_info['title'])?$data_info['title']:'' ?>'  class="form-control validate[required]"  placeholder="请输入设备名称" >
				</div>
			</div>
													
	<div class="form-group">
				<label for="model" class="col-sm-2 control-label form-control-static">设备型号</label>
				<div class="col-sm-9 ">
					<input type="text" name="model"  id="model"  value='<?php echo isset($data_info['model'])?$data_info['model']:'' ?>'  class="form-control validate[required]"  placeholder="请输入设备型号" >
				</div>
			</div>
													
	<div class="form-group">
				<label for="count" class="col-sm-2 control-label form-control-static">设备数量</label>
				<div class="col-sm-9 ">
					<input type="number" name="count"  id="count"  value='<?php echo isset($data_info['count'])?$data_info['count']:'' ?>'   class="form-control  validate[required,custom[integer]]" placeholder="请输入设备数量" >
				</div>
			</div>
													
	<div class="form-group">
				<label for="price" class="col-sm-2 control-label form-control-static">设备单价</label>
				<div class="col-sm-9 ">
					<input type="number" name="price"  id="price"   value='<?php echo isset($data_info['price'])?$data_info['price']:'' ?>'   class="form-control validate[custom[price]]" placeholder="请输入设备单价" >
				</div>
			</div>
													
	<div class="form-group">
				<label for="buy_time" class="col-sm-2 control-label form-control-static">采购时间</label>
				<div class="col-sm-9 ">
					<input type="text" name="buy_time"  id="buy_time"   value='<?php echo isset($data_info['buy_time'])?$data_info['buy_time']:'' ?>'  class="form-control datepicker  validate[required,custom[date]]"  placeholder="请输入采购时间" >
				</div>
			</div>
																																							
	<div class="form-group">
				<label for="status" class="col-sm-2 control-label form-control-static">设备状态</label>
				<div class="col-sm-9 ">
					<select class="form-control  validate[required]"  name="status"  id="status">
				<option value="">==请选择==</option>
								<option value='在用' <?php if(isset($data_info['status'])&&($data_info['status']=='在用')) { ?> selected="selected" <?php } ?>            >在用</option>
				<option value='报废' <?php if(isset($data_info['status'])&&($data_info['status']=='报废')) { ?> selected="selected" <?php } ?>            >报废</option>
</select>
				</div>
			</div>
																										
	<div class="form-group">
				<label for="picture" class="col-sm-2 control-label form-control-static">设备图片</label>
				<div class="col-sm-9 ">
					<a id="picture_a"  ><img  width="100" id="picture_SRC" border="1" src="<?php echo SITE_URL?><?php echo isset($data_info["picture"])?"uploadfile/equipment/".$data_info["picture"]:"images/nopic.gif" ?>"/></a>
<input type="hidden" id="picture" name="picture" value="<?php echo isset($data_info["picture"])?$data_info["picture"]:"" ?>" /> <a id="picture_b" class="btn btn-default btn-sm" > 选择图片 ...</a><span class="help-block">只支持图片上传.</span>
				</div>
			</div>
											</fieldset>
									<fieldset>
						<legend>附加信息</legend>
													
	<div class="form-group">
				<label for="notes" class="col-sm-2 control-label form-control-static">备注信息</label>
				<div class="col-sm-9 ">
					<textarea name="notes"  id="notes"  cols="45" rows="5" class="form-control " placeholder="请输入备注信息" > <?php echo isset($data_info['notes'])?$data_info['notes']:'' ?></textarea>
				</div>
			</div>
											</fieldset>
							<div class='form-actions'>
				<button class='btn btn-primary ' type='submit' id="dosubmit">保存</button>
			</div>
</form>
			<script language="javascript" type="text/javascript">
			var is_edit =<?php echo ($is_edit)?"true":"false" ?>;
			var id =<?php echo $id;?>;

			require(['<?php echo SITE_URL?>scripts/common.js'], function (common) {
		        require(['<?php echo SITE_URL?>scripts/adminpanel/equipment/edit.js']);
		    });
		</script>
	
	